/*
 * $Id: layout.js 3172 2013-08-13 10:53:58Z liujiaguang $
 *
 * Copyright (C) 2008-2014 hezhe. All rights reserved.
 */

$(function() {
    // 首先隐藏所有子菜单
    //$(".menu_content").hide();
    // 隐藏帮助信息
    $("#helpInfo").hide();
});

// 是否隐藏布局
var hiddenLayoutFlag = false;
// 是否隐藏帮助
var hiddenHelpInfoFlag = false;

function switchHelpInfo() {
    $("#helpInfo").toggle();
    var helpInfoImg = $("#helpInfoImg");
    hiddenHelpInfoFlag = !hiddenHelpInfoFlag;
    if (hiddenHelpInfoFlag) {
        helpInfoImg.attr("class", "ui-icon ui-icon-note");
        helpInfoImg.attr("title", "隐藏帮助");
    } else {
        helpInfoImg.attr("class", "ui-icon ui-icon-help");
        helpInfoImg.attr("title", "显示帮助");
    }
}

// 切换页面布局
function switchLayout() {
    // init instance var
    var myLayout = $('body').layout();

    var switherId = $("#switherId");
    hiddenLayoutFlag = !hiddenLayoutFlag;
    if (hiddenLayoutFlag) {
        myLayout.hide('north');
        myLayout.hide('west');
        //myLayout.hide('south');
        switherId.attr("class", "ui-icon ui-icon-newwin");
        switherId.attr("title", "还原");
    } else {
        myLayout.show('north');
        myLayout.show('west');
        //myLayout.show('south');
        switherId.attr("class", "ui-icon ui-icon-arrow-4-diag");
        switherId.attr("title", "最大化");
    }
}